/*
** Mortem's HGE Addon 1.3
** Copyright (C) 2006-2007, Osokin 'elmortem' Makar
** http://elmortem.mirgames.ru
**
** Target fader.
*/

#ifndef _MHAFADER_H_
#define _MHAFADER_H_

#include <hge.h>
#include <hgedistort.h>
#include <mhaengine.h>
#include <mhacallback.h>

#define MHAFADER_TIME 1.f
#define MHAFADER_SPEED 1.f

enum {
	MHAFADER_BEGIN = 0,
	MHAFADER_END
};

enum {
	MHAFADEREFFECT_ALPHA = 0,
	MHAFADEREFFECT_WAVE,
	MHAFADEREFFECT_WAVE_REVERSE,
	MHAFADEREFFECT_OCEAN,
	MHAFADEREFFECT_WATERDOWN
};

class mhaFader {
public:
	mhaFader(float size = 50.f, mhaCallback *callback = 0);
	~mhaFader(void);
	
	void Set(int effect = MHAFADEREFFECT_ALPHA, float time = MHAFADER_TIME, float speed = MHAFADER_SPEED);
	void Restore(void);
	bool Update(float delta);
	void Render(void);

protected:
	static HGE *hge;
	HTARGET Target;
	float Size;
	int DistortWidth, DistortHeight;
	hgeDistortionMesh *Distort;
	int Effect;
	float MaxTime, Time;
	float Speed;
	mhaCallback *Callback;
};

#endif
